package com.luxuewen.sxa.rabbitmq.consumer;

import com.luxuewen.sxa.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class SpringConsumer {
    @RabbitListener(queues = RabbitMQConfig.SPRING_QUEUE)
    public void listenSpring (String message) {
        System.out.println("收到消息："+message);
    }

    @RabbitListener(queues = RabbitMQConfig.SPRING1_QUEUE)
    public void listenSpring1 (String message) {
        System.out.println("1收到消息："+message);
    }
}
